package com.iraeta.service.basic.impl;

import com.iraeta.dao.main.basic.StudentDao;
import com.iraeta.entity.main.Student;
import com.iraeta.service.basic.StudentService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

@Service
public class StudentServiceImpl implements StudentService {
    @Resource
    StudentDao studentDao;

    @Override
    public Student getStudent(int id) {
        return studentDao.getStudentById(id);
    }

    @Override
    public List<Student> getStudentByCondition(String name, String startDate, String endDate) {
        return studentDao.getStudentByCondition(name, startDate, endDate);
    }

    @Override
    public int addStudent(Student student) {
        return studentDao.insertStudent(student);
    }

    @Override
    public int updateStudent(Student student) {
        return studentDao.updateStudent(student);
    }

    @Override
    public int deleteStudent(int id) {
        return studentDao.deleteStudent(id);
    }
}
